<template>
    <div class="header">  
        <div class="l-header">
            <el-button @click="ChangeShow" icon="el-icon-menu" size="mini" style="margin-right: 20px;"></el-button>
            <el-breadcrumb separator="/">
                <el-breadcrumb-item v-for="item in tags" :key="item.name" :to="{ path: item.path }" class="wait">{{ item.label }}</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="r-header">
            <el-dropdown @command="handleClick">
                <span class="el-dropdown-link">
                    <img class="images" src="../../1.jpg">
                </span>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item>个人中心</el-dropdown-item>
                    <el-dropdown-item command="cancel" >退出</el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
        </div>
        </div>
</template>
<script>
import { mapState } from 'vuex'
import Cookie from 'js-cookie'
export default {
    methods:{
        ChangeShow(){
            this.$store.commit('changeShow')
        },
        handleClick(command){
            if( command === 'cancel')
        {
             Cookie.remove('token')
             Cookie.remove('menu')

             //跳转到登录页面
             this.$router.push('/login')
        }
           
        }
    },
    computed:{
        
    ...mapState({
      tags:state => state.tab.tabList
    })
    }
}
</script>
<style lang="less" scoped>
.header{
    padding: 0 20px;
    height: 60px;
    background-color: #454545;
    display:flex;
    justify-content: space-between;
    align-items: center;
    .l-header{
        display:flex;
        align-items: center;
        //样式的穿刺
        /deep/.el-breadcrumb__item{
            .el-breadcrumb__inner{
                font-weight: normal;
                &.is-link{
                    color: #535c77;
                }
            }
            &:last-child{
                .el-breadcrumb__inner{
                    color:white;
                }
            }
        }
    }
}
.medium{
    color:azure;
    padding: 10px;
}
.images{
    width: 40px;
    height: 40px;
   border-radius: 50%;
   margin-top: 20px;

}
.r-header{
    display: flex;
    align-items: center;
}
</style>